package com.medusa.aps.business.modules.security.mp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.medusa.aps.business.model.pagination.Page;
import com.medusa.aps.business.modules.security.model.input.RoleMenuQueryPara;
import com.medusa.aps.business.modules.security.mp.entity.Menu;
import com.medusa.aps.business.modules.security.mp.entity.RoleMenu;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;


/**
 * @author: xianhui.yu
 **/
public interface RoleMenuMapper extends BaseMapper<RoleMenu> {

    /**
     * 列表分页
     *
     * @param page
     * @param filter
     * @return
     */
    List<RoleMenu> selectRoleMenus(Page page, @Param("filter") RoleMenuQueryPara filter);

    /**
     * 列表
     *
     * @param filter
     * @return
     */
    List<RoleMenu> selectRoleMenus(@Param("filter") RoleMenuQueryPara filter);

    /**
     * 根据角色Id删除用户与菜单相关联数据
     *
     * @param roleId:
     * @return: void
     */
    void deleteByRoleId(@Param("roleId") Integer roleId);


    /**
     * 根据角色ID查询关联菜单
     *
     * @param roleIds:
     */
    List<Menu> selectMenusByRoleId(@Param("roleIds") Set<Integer> roleIds);

}
